<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.7.1.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function addUser(){
		var form = document.forms[0];
		form.action="/SpringMVCframe/users/addUsers";
		form.method="post";
		form.submit();
	}
	/* $(document).ready(function(){  
     $.ajax({
				url:"/SpringMVCframe/users/getAllJson",
                cache: true,
                type: "POST",
                /* data:$('#yourformid').serialize(),// 你的formid 
                async: false,
                 dataType: "json",
                error: function(request) {
                   alert("删除失败");
                },
                success: function(data) {
                alert(data.tj.id);
                  alert("删除成功");
                  window.location.reload();
                }
            });   
}); */
function test(){

$.ajax({
				url:"/SpringMVCframe/users/getAllJson",
                cache: true,
                type: "POST",
               //data:{name:name,age:age},
                /* data:$('#yourformid').serialize(),// 你的formid */
                async: true,
                dataType: "json",
                error: function(request) {
                   alert("删除失败");
                },
                success: function(data) {
                alert(data.tj.id);
                  alert("删除成功");
                  window.location.reload();
                }
            });  
} 
</script>
</head>
<body>
	<h>添加用户</h>
	<form name="userForm" method="post">
	id：<input type="text" name="id"  >
		姓名：<input type="text" name="username" >
		账号：<input type="text" name="acount" >
		年龄：<input type="text" name="age" >
		电话：<input type="text" name="telephone" >
		
		<input type="button" value="添加" onclick="addUser()">
		<input type="button" value="test" onclick="test()">
		
	
	</form>
	
	
	
</body>
</html>